package behavioralPattern.command.example01;

public class Client {
    public static void main(String[] args) {
        // 封装参数
        Order order1 = new Order();
        Order order2 = new Order();
        // 创建接收者
        Chef chef = new Chef();
        // 组装命令对象
        OrderCommand command_1 = new OrderCommand(chef, order1);
        OrderCommand command_2 = new OrderCommand(chef, order2);
        // 创建调用者
        Waiter waiter = new Waiter();
        waiter.addCommand(command_1);
        waiter.addCommand(command_2);
        // 调用者调用抽象命令的方法
        waiter.orderUp();
    }
}
